<template>
  <ChangePasswordPage ref="changePasswordPageRef" @postHttp="postHttp"></ChangePasswordPage>
</template>
<script setup>
import { ChangePasswordPage } from '@fssc/admin'
import { changePassword } from '../../api/passport-auth'
import { useUserStore } from '../../store'
import { ref } from 'vue'

const changePasswordPageRef = ref(null)
const userStore = useUserStore()
const postHttp = (data) => {
  changePassword({
    email: userStore.userInfo.email,
    ...data
  }).then(() => {
    userStore.requestLogout(false)
  })
}
</script>
